package crack;

import org.junit.Test;

/**
 * @author fance
 * @date 18-3-31 上午11:57
 */
public class MidHard {
    public int cntFactZero(int n) {
        int cnt = 0;
        if (n < 0) {
            return -1;
        }
        for (int i = 5; n / i > 0 ; i *= 5) {
            cnt += n / i;
        }
        return cnt;
    }

    @Test
    public void test() {
        System.out.println(cntFactZero(5));
    }

}
